home *** CD-ROM | disk | FTP | other *** search
/ SPACE 1 / SPACE - Library 1 - Volume 1.iso / program / 569 / c_libs1a / demo.c < prev    next >
C/C++ Source or Header  |  1992-04-30  |  3KB  |  83 lines

  1. /****************************************/
  2. /*                DEMO.C                */
  3. /*       Written by Scott Sanders       */
  4. /* (c)1992 Software Development Systems */
  5. /*        C Library A - Version 1       */
  6. /*              Demo Program            */
  7. /****************************************/
  8.  
  9. #include <AES.H>
  10. #include <VDI.H>
  11. #include <OSBIND.H>
  12. #include <OBDEFS.H>
  13. #include "NEWALERT.H"
  14.  
  15. short IMAG0[] = {
  16. 0x0, 0x0, 0x0, 0x0, 
  17. 0x0, 0x0, 0x1FF, 0xFF80, 
  18. 0x200, 0x40, 0x23F, 0xFE40, 
  19. 0xE3F, 0xFF70, 0x1020, 0x188, 
  20. 0x201F, 0xFE04, 0x4000, 0x2, 
  21. 0x7FFF, 0xFFFE, 0x80AA, 0xAAA1, 
  22. 0x8055, 0x5551, 0xFFFF, 0xFFFF, 
  23. 0x8000, 0x1, 0x8000, 0x1, 
  24. 0x807F, 0xFFF1, 0x806A, 0xAAB1, 
  25. 0x8055, 0x5551, 0x8000, 0x1, 
  26. 0x81FF, 0xFFFD, 0x807F, 0xFFF1, 
  27. 0x807F, 0xFFF1, 0x807F, 0xFFF1, 
  28. 0xFFEA, 0xAABF, 0xD575, 0x5575, 
  29. 0xAAAA, 0xAAAB, 0x7FFF, 0xFFFE, 
  30. 0x3FFF, 0xFFFC, 0x0, 0x0, 
  31. 0x0, 0x0, 0x0, 0x0};
  32.  
  33. int
  34. main()
  35. {
  36.     OBJECT *tree;
  37.     GRECT form,orig;
  38.  
  39.     appl_init();
  40.     
  41.     if(!rsrc_load("DEMO.RSC"))
  42.         exit(0);
  43.         
  44.     rsrc_gaddr(R_TREE,0,&tree);
  45.     
  46.     wind_get(DESK,WF_CURRXYWH,ELTS(&form));
  47.     
  48.     form.g_h /= 2;    /* Place the object above center */
  49.     
  50.     form_ncenter(tree,&form);    /* Here's call #1 */
  51.     orig.g_x = form.g_x;
  52.     orig.g_y = form.g_y;
  53.     orig.g_w = form.g_w;
  54.     orig.g_h = form.g_h;
  55.     
  56.     form_dial(FMD_START,0,0,0,0,ELTS(orig));
  57.     form_dial(FMD_GROW,0,0,0,0,ELTS(orig));
  58.     objc_draw(tree,ROOT,MAX_DEPTH,ELTS(form));
  59.  
  60.     if(form_nalert(NULL,1,"[1][Welcome to the|form_nalert()|and form_ncenter()|demo program!][Yippee]",NULL)<0)
  61.         form_alert(1,"[0][Form Error][Ok]");
  62.     if(form_nalert(NULL,2,"[0][All of the alerts you'll|see in this program we're|actually form_nalert()|calls.][Great|So What!]",NULL)<0)
  63.         form_alert(1,"[0][Form Error][Ok]");
  64.     if(form_nalert(&form,3,"[2][These alerts can be centered|because form_nalert() uses|form_ncenter(), another|included call.][Hey,|that's|great]",NULL)<0)
  65.         form_alert(1,"[0][Form Error][Ok]");
  66.  
  67.     form.g_w /=2;
  68.     if(form_nalert(&form,1,"[4][Forms can be placed|anywhere and have custom|icons assigned to them.][Neat]",IMAG0)<0)
  69.         form_alert(1,"[0][Form Error][Ok]");
  70.     if(form_nalert(NULL,1,"[1][012345678901234567890123456789|012345678901234567890123456789|012345678901234567890123456789|012345678901234567890123456789|012345678901234567890123456789][-As large-|--as  it--|---gets---]",NULL)<0)
  71.         form_alert(1,"[0][Form Error][Ok]");
  72.     if(form_nalert(NULL,2,"[0][Thank you for trying|this demo. Have a nice|day!][(c)1992|SDS]",NULL)<0)
  73.         form_alert(1,"[0][Form Error][Ok]");
  74.  
  75.     form_dial(FMD_SHRINK,0,0,0,0,ELTS(orig));
  76.     form_dial(FMD_FINISH,0,0,0,0,ELTS(orig));
  77.     rsrc_free();
  78.     appl_exit();
  79. }
  80.     
  81.     
  82.     
  83.